<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>日志管理</title>
    <link rel="shortcut icon" th:href="@{/img/favicon.ico}"/>
    <link rel="bookmark" th:href="@{/img/favicon.ico}" type="image/x-icon"/>
    <link th:href="@{/css/style.css}" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" th:src="@{/js/jquery.js}"></script>
    <script type="text/javascript" th:src="@{/laydate/laydate.js}"></script>
    <script type="text/javascript">
        function tipOpen(content) {
            $(".tipright p").text(content);
            $("#tip").fadeIn(200);
        }

        function tipClose() {
            $("#tip").fadeOut(200);
        }
    </script>
    <style>
        #logForm .ellipsis{
            width: 200px;
            height: 35px;
            line-height: 35px;
            text-overflow: ellipsis;
            overflow: hidden;
            white-space: nowrap;
        }
    </style>
</head>

<body>
<div class="place"><span>位置：</span>
    <ul class="placeul">
        <li><a th:href="@{/sys/users/userall}">系统管理</a></li>
        <li><a th:href="@{/sys/logs/logList}">日志管理</a></li>
    </ul>
</div>
<div class="rightinfo">
    <form th:action="@{/sys/logs/logList}" method="post" id="logForm">
        <input type="hidden" name="pageno" value="1" id="pageno"/>
        <ul class="tools">
            <li><label>员工编号:</label>
                <input type="text" name="uid" th:value="${logParams.uid}"/>
            </li>
            <li><label>员工姓名:</label>
                <input type="text" name="uname" th:value="${logParams.uname}"/>
            </li>
            <li><label>日志内容：</label>
                <input type="text" name="jcontent" th:value="${logParams.jcontent}"/>
            </li>
            <li><label>操作模块：</label>
                <input type="text" name="mname" th:value="${logParams.mname}"/>
            </li>
            <li><label>记录时间:</label>
                <input type="text" disabled class="dfinput laydate-icon" id="logStartTime" name="startTime" th:value="${logParams.startTime}"/>
                <label>-</label>
                <input type="text" disabled class="dfinput laydate-icon" id="logEndTime" name="endTime" th:value="${logParams.endTime}"/>
            </li>
            <li class="subBut" onclick="goPage(1)"><img th:src="@{/images/t06.png}"/>查询</li>
            <li class="subBut" onclick="reset()"><img th:src="@{/images/t03.png}"/>重置</li>
        </ul>
        <table class="tablelist">
            <thead>
            <tr>
                <th>序号</th>
                <th>员工编号</th>
                <th>员工姓名</th>
                <th>操作模块</th>
                <th>日志内容</th>
                <th>记录时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="log,var : ${logInfo.list}">
                <td th:text="${(logInfo.pageNum-1)*logInfo.pageSize+var.count}"></td>
                <td th:text="${log.uId}"></td>
                <td th:text="${log.users.uname}"></td>
                <td th:text="${log.module.moduleRname}"></td>
                <td class="ellipsis" th:text="${log.jcontent}"></td>
                <td th:text="${#dates.format(log.jdate,'yyyy/MM/dd hh:mm:ss')}"></td>
                <td>
                    <a th:href="@{'/sys/logs/dateils/'+${log.jId}}" class="tablelink">查看日志信息</a>
                </td>
            </tr>

            </tbody>
        </table>
        <div class="pagin">
            <div class="message">共<i class="blue" th:text="${logInfo.total}"></i>条记录，当前显示第&nbsp;<i class="blue"
                                                                                                   th:text="${logInfo.pageNum}">2&nbsp;</i>页
            </div>
            <ul class="paginList">
                <li class="paginItem">
                    <a href="javascript:void(0);" th:onclick="goPage([[${logInfo.isFirstPage?1:logInfo.pageNum-1}]])">
                        <span th:class="${logInfo.isFirstPage?'pagepre':'pagenxt roate'}"></span>
                    </a>
                </li>
                <li th:class="${page==logInfo.pageNum?'paginItem current':'paginItem'}"
                    th:each="page : ${logInfo.navigatepageNums}">
                    <a href="javascript:;" th:text="${page}" th:onclick="goPage([[${page}]])">1</a>
                </li>
                <li class="paginItem">
                    <a href="javascript:void(0);"
                       th:onclick="goPage([[${logInfo.isLastPage?logInfo.pages:logInfo.pageNum+1}]])">
                        <span th:class="${logInfo.isLastPage?'pagepre roate':'pagenxt'}"></span>
                    </a>
                </li>
            </ul>
        </div>
    </form>
    <!-- 提示框 -->
    <div id="tip" class="tip">
        <div class="tiptop"><span>提示信息</span><a onclick="tipClose()"></a></div>
        <div class="tipinfo"><span><img th:src="@{/images/ticon.png}"/></span>
            <div class="tipright">
                <p></p>
                <cite>如果是请点击确定按钮 ，否则请点取消。</cite></div>
        </div>
        <div class="tipbtn">
            <input name="" type="button" class="sure" value="确定" onclick="tipClose()"/>
            &nbsp;
            <input name="" type="button" class="cancel" value="取消" onclick="tipClose()"/>
        </div>
    </div>
</div>
<script type="text/javascript">
    $('.tablelist tbody tr:odd').addClass('odd');

    //执行一个laydate实例
    laydate.render({
        elem: '#logStartTime' //指定元素
    });
    laydate.render({
        elem: '#logEndTime' //指定元素
    });

    //表单提交
    function goPage(num) {
        $("#pageno").val(num);
        $("#logForm").submit();
    }

    function reset() {
        $("input[name=uid]").val("");
        $("input[name=uname]").val("");
        $("input[name=jcontent]").val("");
        $("input[name=mname]").val("");
    }
</script>
</body>
</html>
